package com.epfresh.api.constant;

/**
 * Created by wzh on 2016/4/26.
 */
public class Constant {
    //发布版本
    public static int ENV_RELEASE = 0;
    //发布版本
    public static int ENV_RC = 1;
    //测试版本
    public static int ENV_BETA = 2;
    //开发版本
    public static int ENV_DEV = 3;
    //当前版本
    public static int ENV_CUR = 0;

    public static int ENV = 0;

    public static String APP_DOMAIN_SUPPLIER = "supplier";
    public static String APP_DOMAIN_PURCHASER = "purchaser";
    public static boolean DEV = true;
    public static String USER_INFO_FILE_KEY = "user_info_file_key";
    public static String STORE_INFO_FILE_KEY = "store_info_file_key";
    public static String USER_STR = "user_str";
    public static String CITY_STR = "city_str";
    public static String STORE_INFO_STR = "store_info_str";
    public static String KEY_PICK_UP_ADDRESS = "key_pick_up_address";
    public static String KEY_STORE_DETAIL_IMAGE_ADDRESS = "key_store_detail_image_address";


    //跳转web页面的url
    public static String KEY_WEB_URL = "key_web_url";
    //跳转web页面的title
    public static String KEY_WEB_TITLE = "key_web_title";

    public static boolean isDEV = false;
    public static String URL_BASE = "http://api.epfresh.com/cgi";
    //基地修改了接口所以添加一个，为了保存原来的接口
    public static String NORMAL_URL_BASE = "";
    public static String URL_BASE_TEST = "http://epapifort.epfresh.com/cgi";
    //    public static String URL_BASE_TEST = "http://10.10.47.1/cgi";
//    public static String URL_BASE_TEST = "https://epapifort.epfresh.com/cgi";
    public static String URL_DOC = "http://api.epfresh.com/systemRestController/downloadDoc";
    public static String URL_SHARE_DOWNLOAD = "http://app.epfresh.com/common/download.html?type=supplier";
    //    (a) create-store.html,(a)店铺认证页面（编辑、审核中、认证成功后）右上角添加帮助入口
    //    (b) add-bankcard.html,(b)银行信息（编辑、认证成功）右上角添加帮助入口
    //    (c) certify.html,(c)个人认证页面（编辑页面）右上角添加帮助入口
    //    (d) order.html,(d)订单页面（订单详情）右上角添加帮助入口
    //    (e) product.html,(e)商品页面（商品添加、价格编辑页）右上角添加帮助入口
    public static String URL_HELP = "http://app.epfresh.com/help/";
    public static String URL_HELP_SUPPLIER_AGREEMENT = "http://app.epfresh.com/help/sup-agreement.html";
    public static String URL_HELP_PUR_AGREEMENT = "http://app.epfresh.com/help/pur-agreement.html";
    public static String URL_HELP_SUPPLIER_COUPON = "http://app.epfresh.com/help/sup-coupon.html";
    public static String URL_HELP_PUR_NORMAL = "http://app.epfresh.com/help/pur-faq.html";
    public static String URL_HELP_SUB_NORMAL = "http://app.epfresh.com/help/sup-faq.html";
    public static String URL_HELP_CREATED_STORE = "http://app.epfresh.com/help/openShop.html";
    public static String URL_HELP_STORE_CERT = "http://app.epfresh.com/help/store-cert.html";
    public static String URL_HELP_ADD_BANK = "http://app.epfresh.com/help/bank-info.html";
    public static String URL_HELP_CERTIFY = "http://app.epfresh.com/help/rn-ident.html";
    //    public static String URL_HELP_ORDER = URL_HELP+"order.html";
    public static String URL_HELP_PRODUCT_DC = "http://app.epfresh.com/help/behalfRelease.html";
    public static String URL_HELP_PRODUCT = "http://app.epfresh.com/help/sup-release.html";

    public static String URL_SHARE_BASE = "http://app.epfresh.com/common/product-api.html#";

    public static String URL_ORDER_PURCHASER = "http://app.epfresh.com/purchase/order_detail-api.html?t=";
    public static String URL_ORDER_SUPPLIER = "http://app.epfresh.com/supply/order_supply_new-api.html?";
    public static String URL_ORDER_JOINSUPPLIER = "http://app.epfresh.com/supply/order_supply_joint.html?";
    public static String URL_CLASS_SUPPLIER = "http://app.epfresh.com/supply/ep_splclass.html#_share_";
    public static String URL_CLASS_PURCHASER = "http://app.epfresh.com/purchase/ep_classroom.html#_share_";
    public static String URL_SHARE_COUPON = "http://app.epfresh.com/common/coupon-api.html?";
    public static String URL_SHARE_BASE_PRODUCT_DETAIL = "http://app.epfresh.com/common/product_supply-api.html#";

    public static String URL_BASE_SPELL_LIST = "http://app.epfresh.com/purchase/goods_from_origin.html?";//产地拼货列表
    public static String URL_GOODS_DETAIL_COMMENT = "http://app.epfresh.com/comment.html#/Comment?";//商品详情评价查看
    public static String URL_ORDER_COMMENT = "http://app.epfresh.com/comment.html#/CommentAdd?";//订单评价
    public static String URL_ORDER_TRACE = "http://app.epfresh.com/trace.html#/?";//订单追踪轨迹
    public static String URL_EP_CLASSROOM = "http://app.epfresh.com/purchase/ep_classroom.html#_share_";//e批课堂
    public static String URL_ACTIVITY_TURNTABLE = "http://app.epfresh.com/luckeyRole.html";//主页转盘活动
    public static String URL_HELP_WALLET = "http://m.epfresh.com/help/wallet-desc.html";
    public static String URL_HELP_REDUCTION = "http://m.epfresh.com/help/reduction.html";

    public static String host = "http://api.epfresh.com";
    public static String hostMobile = "http://app.epfresh.com";
    //我要买  代办的H5的接口
    public static String URL_HELP_AGENT_NOTICE = "http://app.epfresh.com/help/base_commission_notice.html";

    public static void init(boolean isDEV, String appDomain) {
        if (isDEV) {/*接口名公共字段；分享下载；文案下载；订单详情；商品详情；e批课堂；分享优惠券*/

            if (ENV_CUR == 0) {//正式版本,rp
                host = "http://api.epfresh.com";
                hostMobile = "http://app.epfresh.com";
            } else if (ENV_CUR == 1) {//rc
                host = "https://apifort.epfresh.cn/api";
                hostMobile = "https://apifort.epfresh.cn/m";
            } else if (ENV_CUR == 2) {//测试版本beta
                host = "https://apitest.epfresh.cn/api";
                hostMobile = "https://apitest.epfresh.cn/m";
            } else if (ENV_CUR == 3) {//dev
                host = "http://apitest.epfresh.cn";
                hostMobile = "http://apitest.epfresh.cn/m";
            }
//**********************新增Chen********************************************************************************************************************************
            URL_ORDER_JOINSUPPLIER = hostMobile + "/supply/order_supply_joint.html?";
            URL_BASE_SPELL_LIST = hostMobile + "/purchase/goods_from_origin.html?";
            URL_GOODS_DETAIL_COMMENT = hostMobile + "/comment.html#/Comment?";
            URL_ORDER_COMMENT = hostMobile + "/comment.html#/CommentAdd?";
            URL_ORDER_TRACE = hostMobile + "/trace.html#/?";
            URL_EP_CLASSROOM = hostMobile + "/purchase/ep_classroom.html#_share_";
            URL_ACTIVITY_TURNTABLE = hostMobile + "/luckeyRole.html";
            URL_HELP_PUR_AGREEMENT = hostMobile + "/help/pur-agreement.html";
            URL_HELP_CERTIFY = hostMobile + "/help/rn-ident.html";
            URL_HELP_WALLET = hostMobile + "/help/wallet-desc.html";
            URL_HELP_REDUCTION = hostMobile + "/help/reduction.html";


//**********************新增Chen*********************************************************************************************************************************

            //    URL_BASE = host + "/cgi";
            NORMAL_URL_BASE = host + "/cgi";
            URL_BASE = NORMAL_URL_BASE;
            URL_SHARE_DOWNLOAD = hostMobile + "/common/download.html?type=" + appDomain;

            URL_DOC = host + "/systemRestController/downloadDoc";

            URL_ORDER_SUPPLIER = hostMobile + "/supply/order_supply_new-api.html?";
            URL_ORDER_PURCHASER = hostMobile + "/purchase/order_detail-api.html?t=";

            URL_SHARE_BASE = hostMobile + "/common/product-api.html#";

            URL_CLASS_SUPPLIER = hostMobile + "/supply/ep_splclass.html";

            URL_SHARE_COUPON = hostMobile + "/common/coupon-api.html?";
            URL_SHARE_BASE_PRODUCT_DETAIL = hostMobile + "/common/product_supply-api.html#";
//            URL_SHARE_BASE = "http://10.10.47.4/product.html#";  分享商品
        } else {
            NORMAL_URL_BASE = "http://api.epfresh.com/cgi";
            URL_BASE = NORMAL_URL_BASE;
            URL_SHARE_DOWNLOAD = "http://app.epfresh.com/common/download.html?type=" + appDomain;

            URL_DOC = "http://api.epfresh.com/systemRestController/downloadDoc";

            URL_ORDER_SUPPLIER = "http://app.epfresh.com/supply/order_supply_new-api.html?";
            URL_ORDER_PURCHASER = "http://app.epfresh.com/purchase/order_detail-api.html?t=";

            URL_SHARE_BASE = "http://app.epfresh.com/common/product-api.html#";

            URL_CLASS_SUPPLIER = "http://app.epfresh.com/supply/ep_splclass.html";

            URL_SHARE_COUPON = "http://app.epfresh.com/common/coupon-api.html?";

            URL_SHARE_BASE_PRODUCT_DETAIL = "http://app.epfresh.com/common/product_supply-api.html?";

        }

    }

    /**
     * 因为基地改了新接口，所以这里还要初始化一个新的
     * 针对于我要买的新接口，进行处理
     */
    //public static String PRODUCT_BASE_URL = "https://api.epfresh.com/purchase/cgi";
    public static void initProductBase(boolean isDEV) {

        if (isDEV) {
            if (ENV_CUR == 0) {//正式版本,rp
                URL_HELP_AGENT_NOTICE = "http://app.epfresh.com/help/base_commission_notice.html";
                host = "http://api.epfresh.com";
            } else if (ENV_CUR == 1) {//rc
                URL_HELP_AGENT_NOTICE = "http://mfort.epfresh.com/help/base_commission_notice.html";
                host = "https://apifort.epfresh.cn/api";
            } else if (ENV_CUR == 2) {//测试版本beta
                URL_HELP_AGENT_NOTICE = "http://mtest.epfresh.com/help/base_commission_notice.html";
//                host = "http://apitest.epfresh.com";
                host = "https://apitest.epfresh.cn/api";
                hostMobile = "https://apitest.epfresh.cn/m";
            } else if (ENV_CUR == 3) {//dev
                host = "http://apitest.epfresh.cn";
                hostMobile = "http://apitest.epfresh.cn/m";
            }

            //PRODUCT_BASE_URL = host+ "/purchase/cgi";
        } else {
            URL_HELP_AGENT_NOTICE = "http://app.epfresh.com/help/base_commission_notice.html";
            //PRODUCT_BASE_URL ="https://api.epfresh.com/purchase/cgi";
        }
    }
}
